import React from "react";
import {Route,Link} from "react-router-dom";
export default  ({to,label}) =>  {
    return (
        //不管匹配不匹配都会去return 出东西
        <Route path={to} children={({match}) => {
            //若匹配则 给一个选中的类名
            return <li className={match?'active':''}><Link to={to} >{label}</Link></li>
        }}/>
    )
}